/**
 * 
 */
package org.cuatrovientos.dungeon;


import java.util.Scanner;


/**
 * 
 * @author David
 *
 */
public class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		int option=0;
		int numDices=0;
		int sides=0;
		Dice myDice= null;
		String line="";
		Scanner reader=new Scanner(System.in);
		
		do{
			System.out.println("Welcome Dungeon Dice");
			System.out.println("1-Create Dice");
			System.out.println("2-Roll a Dice");
			System.out.println("3-Roll an Dices");
			System.out.println("4-Exit");
			line=reader.nextLine();
			option=Integer.parseInt(line);
			switch(option){
			case 1:
				System.out.println("Enter the number sides");
				line=reader.nextLine();
				sides=Integer.parseInt(line);
				System.out.println("Enabled Zero?(Y/N)");
				line=reader.nextLine();

				if (line.charAt(0)=='Y'){
					 myDice = new Dice(sides,true);
				}else{
					myDice = new Dice(sides,false);
				}
				System.out.println("Dice Created");
				break;
				
			case 2:
				System.out.println(myDice.LaunchDice());
				break;
			case 3:
				System.out.println("Enter the number of dices to launch");
				line=reader.nextLine();
				numDices=Integer.parseInt(line);
				for (int i = 0; i<numDices;i++){
					System.out.println(myDice.LaunchDice());
				}
				break;
				
				
				
			
			
			}
		
		}while(option != 4);
		reader.close();
		System.out.println("Finish the program");
	}

}
